package org.apache.shiro.ext;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.IncorrectCredentialsException;

public class ShiroUtils {

	public static String getErrorMsg(Object err) {
		if (err instanceof IncorrectCredentialsException) {
			return "用户名或密码错误";
		} else if(err instanceof AuthenticationException ){
			return ((AuthenticationException) err).getMessage();
		} 
		
		return null;
	}
}
